package com.lx.perferred.mall.admin.bo;

import java.util.Objects;

/**
 * @author lX
 * @version JDK 8
 * @className WebLog (此处以class为例)
 * @date 2024/11/30
 * @description Controller层的日志封装类
 */
public class WebLog {

  /**
   * 操作描述
   */
  private String description;

  /**
   * 操作用户
   */
  private String username;

  /**
   * 操作时间
   */
  private Long operateTime;

  /**
   * 消耗时间
   */
  private Integer costTime;

  /**
   * 根路径
   */
  private String basePath;

  /**
   * URI
   */
  private String uri;

  /**
   * URL
   */
  private String url;

  /**
   * 请求方法名称
   */
  private String methodName;

  /**
   * IP地址
   */
  private String ip;
  /**
   * 请求参数
   */
  private Object parameter;
  /**
   * 请求结果
   */
  private Object result;


  public String getDescription() {
    return description;
  }

  public void setDescription(String description) {
    this.description = description;
  }

  public String getUsername() {
    return username;
  }

  public void setUsername(String username) {
    this.username = username;
  }

  public Long getOperateTime() {
    return operateTime;
  }

  public void setOperateTime(Long operateTime) {
    this.operateTime = operateTime;
  }

  public Integer getCostTime() {
    return costTime;
  }

  public void setCostTime(Integer costTime) {
    this.costTime = costTime;
  }

  public String getBasePath() {
    return basePath;
  }

  public void setBasePath(String basePath) {
    this.basePath = basePath;
  }

  public String getUri() {
    return uri;
  }

  public void setUri(String uri) {
    this.uri = uri;
  }

  public String getUrl() {
    return url;
  }

  public void setUrl(String url) {
    this.url = url;
  }

  public String getMethodName() {
    return methodName;
  }

  public void setMethodName(String methodName) {
    this.methodName = methodName;
  }

  public String getIp() {
    return ip;
  }

  public void setIp(String ip) {
    this.ip = ip;
  }

  public Object getParameter() {
    return parameter;
  }

  public void setParameter(Object parameter) {
    this.parameter = parameter;
  }

  public Object getResult() {
    return result;
  }

  public void setResult(Object result) {
    this.result = result;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;
    WebLog webLog = (WebLog) o;
    return Objects.equals(description, webLog.description) && Objects.equals(username, webLog.username) && Objects.equals(operateTime, webLog.operateTime) && Objects.equals(costTime, webLog.costTime) && Objects.equals(basePath, webLog.basePath) && Objects.equals(uri, webLog.uri) && Objects.equals(url, webLog.url) && Objects.equals(methodName, webLog.methodName) && Objects.equals(ip, webLog.ip) && Objects.equals(parameter, webLog.parameter) && Objects.equals(result, webLog.result);
  }

  @Override
  public int hashCode() {
    return Objects.hash(description, username, operateTime, costTime, basePath, uri, url, methodName, ip, parameter, result);
  }

  @Override
  public String toString() {
    return "WebLog{" +
      "description='" + description + '\'' +
      ", username='" + username + '\'' +
      ", operateTime=" + operateTime +
      ", costTime=" + costTime +
      ", basePath='" + basePath + '\'' +
      ", uri='" + uri + '\'' +
      ", url='" + url + '\'' +
      ", methodName='" + methodName + '\'' +
      ", ip='" + ip + '\'' +
      ", parameter=" + parameter +
      ", result=" + result +
      '}';
  }
}
